/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ModelLager;
import java.sql.Date;
import java.util.ArrayList;
/**
 *
 * @author Alex Ly
 */
public class SalesOrderP {
    private Date date; //date of sale
    private double totalPrice; //total price of sale with vat
    private int deliveryStatus; // 
    private Date deliveryDate; // 
    private double VAT; // vat eg. 25%
    private double totalPriceNoVAT; // total price without vat
    private CustomerP customer;
    private int orderID; 
    private InVoiceP inVoice;
    private ArrayList<PartOrderP> partOrders;

    public SalesOrderP(java.sql.Date date, double totalPrice, int deliveryStatus, Date deliveryDate, double VAT, double totalPriceNoVAT, CustomerP customer, int orderID, InVoiceP inVoice) {
        this.date = date;
        this.totalPrice = totalPrice;
        this.deliveryStatus = deliveryStatus;
        this.deliveryDate = deliveryDate;
        this.VAT = VAT;
        this.totalPriceNoVAT = totalPriceNoVAT;
        this.customer = customer;
        this.orderID = orderID;
        this.inVoice = inVoice;
        partOrders = new ArrayList<PartOrderP>();
    }

    public SalesOrderP() {
        partOrders = new ArrayList<PartOrderP>();
    }
    
    public void addPartOrder(PartOrderP partorder)
    {
        partOrders.add(partorder);
    }
    public void removePartOrder(PartOrderP partorder){
        partOrders.remove(partorder);
    
}
    
    public InVoiceP getInVoice() {
        return inVoice;
    }

    public void setInVoice(InVoiceP inVoice) {
        this.inVoice = inVoice;
    }

    public void setCustomer(CustomerP customerID) {
        this.customer = customer;
    }
    public CustomerP getCustomer()
    {
        return customer;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @param date the date to set
     */
    public void setDate(Date date) {
        this.date = date;
    }

    /**
     * @return the totalPrice
     */
    public double getTotalPrice() {
        return totalPrice;
    }

    /**
     * @param totalPrice the totalPrice to set
     */
    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    /**
     * @return the deliveryStatus
     */
    public int getDeliveryStatus() {
        return deliveryStatus;
    }

    /**
     * @param deliveryStatus the deliveryStatus to set
     */
    public void setDeliveryStatus(int deliveryStatus) {
        this.deliveryStatus = deliveryStatus;
    }

    /**
     * @return the deliveryDate
     */
    public Date getDeliveryDate() {
        return deliveryDate;
    }

    /**
     * @param deliveryDate the deliveryDate to set
     */
    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    /**
     * @return the VAT
     */
    public double getVAT() {
        return VAT;
    }

    /**
     * @param VAT the VAT to set
     */
    public void setVAT(double VAT) {
        this.VAT = VAT;
    }

    /**
     * @return the totalPriceNoVAT
     */
    public double getTotalPriceNoVAT() {
        return totalPriceNoVAT;
    }

    /**
     * @param totalPriceNoVAT the totalPriceNoVAT to set
     */
    public void setTotalPriceNoVAT(double totalPriceNoVAT) {
        this.totalPriceNoVAT = totalPriceNoVAT;
    }

    /**
     * @return the orderID
     */
    public int getOrderID() {
        return orderID;
    }

    /**
     * @param orderID the orderID to set
     */
    public void setOrderID(int orderID) {
        this.orderID = orderID;
    }
    public void addPartOrderP(PartOrderP p)
    {
        partOrders.add(p);
    }
    
    public void removePartOrfderP(PartOrderP p)
    {
            partOrders.remove(p);
    }
    
    
}
